/* ====================================== api 配置  ====================================== */
import Fn 		from './fn'
import Http 	from './http'
import Config 	from './config'
import Lazy 	from './lazy'

const msg 		= Lazy.file(()=>import('@antd/message'))
// const confirm 	= Lazy.file(()=>import('@antd/confirm'))
const notice 	= Lazy.file(()=>import('@antd/notification'))

window.$fn = {
	...Fn,
	msg: {
		success: v => msg.then( f => f.success(v)),
		warning: (v, delay) => msg.then( f => f.warning(v, delay)),
		error: v => msg.then( f => f.error(v))
	},
	// confirm: v => confirm.then( f => f(v)),
	notice:{
		warning: (v,t,o) => notice.then( f => f.warning(v,t,o)),
		success: (v,t,o) => notice.then( f => f.success(v,t,o))
	}
}

window.$http = Http
window.$config = Config
window.$Lazy = Lazy
